<!DOCTYPE html>

{% macro pagination(url, page) %}
    <ul class="uk-pagination">
        {% if page.has_previous %}
            <li><a href="{{ url }}{{ page.page_index - 1 }}"><i class="uk-icon-angle-double-left"></i></a></li>
        {% else %}
            <li class="uk-disabled"><span><i class="uk-icon-angle-double-left"></i></span></li>
        {% endif %}
            <li class="uk-active"><span>{{ page.page_index }}</span></li>
        {% if page.has_next %}
            <li><a href="{{ url }}{{ page.page_index + 1 }}"><i class="uk-icon-angle-double-right"></i></a></li>
        {% else %}
            <li class="uk-disabled"><span><i class="uk-icon-angle-double-right"></i></span></li>
        {% endif %}
    </ul>
{% endmacro %}

<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>{% block title %} ? {% endblock%} - Awesome Python Webapp</title>
    <link rel="stylesheet" href="/static/css/uikit.css"/>
    <link rel="stylesheet" href="/static/css/uikit.gradient.min.css"/>
    <script src="/static/js/jquery-3.1.1.js"></script>
    <script src="/static/js/jquery.sticky.js"></script>
    <script src="/static/js/uikit.js"></script>
    <script src="/static/js/crypto-js.js"></script>
    <script src="/static/js/vue.js"></script>
    {% block beforehead %}<!-- before head  -->{% endblock %}
</head>
<body>
    <nav class="uk-navbar uk-navbar-attached uk-margin-bottom">
        <div class="uk-container uk-container-center">
            <a href="/" class="uk-navbar-brand">Awesome</a>
            <ul class="uk-navbar-nav">
                <li data-url="blogs"><a href="/"><i class="uk-icon-home">日志</i> </a> </li>
                <li><a target="_blank" href="#"><i class="uk-icon-book">教程</i> </a> </li>
                <li><a target="_blank" href="#"><i class="uk-icon-book">源码</i> </a> </li>
            </ul>
            <div class="uk-navbar-nav">
                <ul class="uk-navbar-nav">
                    {% if user %}
                        <li class="uk-dropdown">
                            <a href="#0"><li class="uk-icon-user">{{user.name}}</li> </a>
                            <div class="uk-dropdown uk-dropdown-navbar">
                                <ul class="uk-nav uk-nav-navbar">
                                    <li><a href="/signout"><i class="uk-icon-sign-out"></i>登出</a></li>
                                </ul>
                            </div>

                        </li>
                    {% else %}
                        <li><a href="/signin"><i class="uk-icon-sign-in"></i>登录</a> </li>
                        <li><a href="/register"><i class="uk-icon-edit"></i>注册</a> </li>
                    {% endif %}
                </ul>
            </div>
        </div>
    </nav>

    <div class="uk-container uk-container-center">
        <div class="uk-grid">
            <!-- content -->
            {% block content %}
            {% endblock %}
            <!-- // content -->
        </div>
    </div>

    <div class="uk-margin-large-top" style="background-color:#eee; border-top:1px solid #ccc;">
        <div class="uk-container uk-container-center uk-text-center">
            <div class="uk-panel uk-margin-top uk-margin-bottom">
                <p>
                    <a target="_blank" href="#" class="uk-icon-button uk-icon-weibo"></a>
                    <a target="_blank" href="#" class="uk-icon-button uk-icon-github"></a>
                    <a target="_blank" href="#" class="uk-icon-button uk-icon-linkedin-square"></a>
                    <a target="_blank" href="#" class="uk-icon-button uk-icon-twitter"></a>
                </p>
                <p>Powered by <a href="#">Awesome Python Webapp</a>. Copyright &copy; 2017. [<a href="/manage/" target="_blank">Manage</a>]</p>
                <p><a href="https://my.oschina.net/leonhu/blog" target="_blank">gdhu</a>. All rights reserved.</p>
                <a target="_blank" href="#"><i class="uk-icon-html5" style="font-size:64px; color: #444;"></i></a>
            </div>
        </div>
    </div>
</body>
</html>